//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   ZeroSource.hh
 * \author Jeremy Roberts
 * \date   05/23/2011
 * \brief  ZeroSource class definition.
 * \note   Copyright (C) Jeremy Roberts.
 */
//---------------------------------------------------------------------------//
// $Rev::                                               $:Rev of last commit
// $Author::                                            $:Author of last commit
// $Date::                                              $:Date of last commit
//---------------------------------------------------------------------------//

#ifndef ZEROSOURCE_HH
#define ZEROSOURCE_HH

#include <iostream>

#include "BaseSource.hh"
#include "angle/AngleTraits.hh"
#include "angle/Octant.hh"
#include "../utilities/SP.hh"

namespace slabtran
{

//===========================================================================//
/*!
 * \class ZeroSource
 * \brief Derived BaseSource defining a zero external source using no
 *        memory.
 *
 * Instead of generating a source represented underneath by zero vectors,
 * we simply return a zero.  This is useful e.g. when we have surface sources
 * or incident fluxes with no external sources, as is the case for response
 * function generation.  Note, we also allow a single constant source
 * strength to be set, of use for debugging and scoping studies.
 *
 * \tparam D    dimension
 *
 * \todo Make a new UniformSource class to set a single value for all
 *       groups or separate group values.
 *
 */
//===========================================================================//

template <class D>
class ZeroSource : public BaseSource<D>
{

public:
  //@{
  //! Useful typedefs for classes that use ZeroSource
  typedef util::SP<ZeroSource<D> >          SP_source;
  typedef typename Octant<D>::Omega         Omega;
  //@}

  /// Constructor.
  ZeroSource() :
    BaseSource<D>(),
    d_number_groups(0)
  {
    //
  }

  // >>> DERIVED INTERFACE

  /// Return the number of groups.
  int number_groups() const
  {
    return d_number_groups;
  }

  /*
   *  \brief Get source in particles/cm^3-ster.
   *
   *  \param    cell    Spatial cell of source.
   *  \param    angle   Angle.
   *  \param    g       Group of requested source.
   *  \return           Source for requested cell, angle, and direction.
   *
   */
  double q_e(int cell, const Omega &angle, int g) const
  {
    return 0.0;
  }

  /// Verify that all of the sources have been assigned.
  bool verify() const
  {
    return d_number_groups;
  }

  // >>> CLASS INTERFACE

  /// Set the number of groups.
  void set_number_groups(int number_groups)
  {
    Require (number_groups > 0);
    d_number_groups = number_groups;
  }

private:

  // >>> DATA

  /// Number of groups.
  const int d_number_groups;

};

} // end namespace slabtran

#endif // ZEROSOURCE_HH

//---------------------------------------------------------------------------//
//              end of ZeroSource.hh
//---------------------------------------------------------------------------//
